<html>
<head>
<style>
@page {
  size: 400px 500px;
  margin: 10px;
}
body {
  margin: 0;
}
body > div {
  margin-top: 10px;
}
.container {
  width: 200px;
  border: 1px solid green;
  height: 50px;
}
.inside {
  height: 100%;
  box-sizing: border-box;
  border: 1px solid red;
  width: 300px;
  background-color: orange;
}
.grandparent {
  border: 1px solid blue;
  width: 250px;
}
.float {
  float: right;
  background-color: purple;
  width: 150px;
  height: 100%;
}
</style>
</head>
<body>
<div class="container" style="overflow:hidden;"><div class="inside"></div></div>
<div class="container" style="overflow:visible;"><div class="inside"></div></div>

<div class="grandparent"><div class="container" style="overflow:visible;"><div class="inside"></div></div></div>
<div class="grandparent"><div class="container" style="overflow:hidden;"><div class="inside"></div></div></div>

<div class="container" style="overflow:visible;"><div class="inside"><div class="float"></div></div></div>


</body>
</html>
